import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
export default new Vuex.Store({
  state: {
    num:1,
  },
  mutations: {
    jia(state,num){
       state.num= state.num + num
    },
    jian(state,num){
      state.num = state.num - num
    }
  },
  actions: {
     jia(a,num){      
      a.commit("jia",num)
     },
     jian(b,num){
      b.commit("jian",num)
     }
  },
  modules: {
  }
})
